package com.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api
@RestController
@RequestMapping
public class myController {

    @GetMapping("/hello")
    public String Hello(){
        System.out.println("进入hello方法");
        return "返回后端数据";
    }
    @GetMapping("/getu")
    @ApiImplicitParams({@ApiImplicitParam(name="username",value="姓名",example = "admin",dataTypeClass =String.class),
            @ApiImplicitParam(name="age",value="年龄",example = "16",dataTypeClass = Integer.class)})
    public String GetUser(String username,Integer age){
        System.out.println("用户名称"+username);
        System.out.println("年龄"+age);
        return "获取前端数据并返回后端数据";
    }
}
